import SubForm from './sub-form'
import SubGrid from './sub-grid'
import FlowChart from './flow-chart'
import FlowStatus from './flow-status'
import EmapFlowComment from './emap-flow-comment'
import EmapFlowNextStep from './emap-flow-next-step'
import SectionTitle from './section-title'

const ControlTypes = {
  [SubForm.name]: SubForm,
  [SubGrid.name]: SubGrid,
  [FlowChart.name]: FlowChart,
  [EmapFlowComment.name]: EmapFlowComment,
  [EmapFlowNextStep.name]: EmapFlowNextStep,
  [SectionTitle.name]: SectionTitle,
  [FlowStatus.name]: FlowStatus,
}

// 根据控件类型获取渲染组件
export const getControl = (type) => {
  return type && ControlTypes[type] || null
}
